<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<link rel="stylesheet" href="${pageContext.request.contextPath}/bootstrap/css/bootstrap.min.css">
	<link rel="stylesheet" href="${pageContext.request.contextPath}/bootstrap/css/bootstrap.min.css">
	<link rel="stylesheet" href="${pageContext.request.contextPath}/css/font-awesome.min.css">

	<style>
	.tree li{
        list-style-type: none;
		cursor:pointer;
	}
	</style>
</head>
<body>
	<div class="col-sm-12 col-sm-offset-0 col-md-12 col-md-offset-0 main">
		<ol class="breadcrumb">
		  <li><a href="#">首页</a></li>
		  <li><a href="#">登记房屋</a></li>
		</ol>
		<div class="panel panel-default">
		
	      <div class="panel-heading">表单数据<div style="float:right;cursor:pointer;" data-toggle="modal" data-target="#myModal"><i class="glyphicon glyphicon-question-sign"></i></div></div>
		  	<div class="panel-body">
				<form role="form" id="form1" action="${pageContext.request.contextPath}/houses/getHousesById">
				  <div class="form-group" style="padding: 20px;">
		       		<label for="exampleInputPassword1" class="col-sm-2 control-label" style="text-align: center;">楼盘编号：</label>
					<div class="col-sm-8">
						<input type="text" class="form-control" name="id" placeholder="请输入楼盘编号" required>
				  	</div>
				  	<div class="col-sm-2">
						<button type="button" id="housesId" class="btn btn-primary">查询</button>
					</div>
				 </div>
				</form>
		 	</div>
		</div>
      </div>
	<script src="${pageContext.request.contextPath}/jquery/jquery-2.1.1.min.js"></script>
    <script src="${pageContext.request.contextPath}/bootstrap/js/bootstrap.min.js"></script>
	<script src="${pageContext.request.contextPath}/script/docs.min.js"></script>
	<script type="text/javascript">
		$(function(){
			getHouses();
		});
		function getHouses(){
			$("#housesId").click(function(){
				var id=$("[name=id]").val();
				$.ajax({
					url:"${pageContext.request.contextPath}/houses/getHousesById",
					type:"post",
					async:true,
					data:{"id":id},
					error:function(){
						
					},
					success:function(data){
						if(data.trim()=='"OK"'){
							location.href="${pageContext.request.contextPath}/houseRegister/getHouses.jsp";
						}else{
							alert("没有找到！");
						}
					}
				});
			});
		}
	</script>
</body>
</html>